package com.Test;

import java.util.HashSet;
import java.util.Set;

/**
 * 客户端
 *
 * @author: 陌溪
 * @create: 2020-04-03-22:48
 */
public class Client {
    public static void main(String[] args) {
        OrderService orderService = new OrderService();
        Set set = new HashSet();
        for (int i = 0; i < 2000; i++) {
            new Thread(() -> {
                String str = orderService.getOrderNumber();

                boolean sign = set.add(str);

                if(!sign) {
                    System.err.println(str);
                }

            }, String.valueOf(i)).start();
        }


    }
}
